package Exercise;

import java.util.ArrayList;

public class Test114 {
    public static void main(String[] args) {
        ArrayList<User> list = new ArrayList<>();
        User u1 = new User("1", "1342321", "144131");
        User u2 = new User("2", "1342364", "1442y2");
        User u3 = new User("3", "1347533", "144425");
        list.add(u1);
        list.add(u2);
        list.add(u3);
        Boolean flag = Find(list,"3");
        System.out.println(flag);

    }

    public static boolean Find(ArrayList<User> list, String s1) {
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).getId().equals(s1)) {
                return true;
            }
        }
        return false;
    }
}
